package com.company.bookstore.security;

import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;


/**
 * AdminnamePasswordToken
 * 管理员专用token
 *
 * @blame Android Team
 */
public class AdminnamePasswordToken  extends UsernamePasswordAuthenticationToken {

    // ~ Constructors
    // ===================================================================================================

    /**
     * This constructor can be safely used by any code that wishes to create a
     * <code>UsernamePasswordAuthenticationToken</code>, as the {@link #isAuthenticated()}
     * will return <code>false</code>.
     *
     */
    public AdminnamePasswordToken(Object principal, Object credentials) {
        super(principal,credentials);
        super.setAuthenticated(false);
    }
    public AdminnamePasswordToken(Object principal, Object credentials,
                                 Collection<? extends GrantedAuthority> authorities) {
        super(principal,credentials,authorities);
        super.setAuthenticated(true);
    }

}
